//
//  CPStatusBottomView.swift
//  weibo
//
//  Created by zcp on 16/5/17.
//  Copyright © 2016年 zcp. All rights reserved.
//

import UIKit

class CPStatusBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        prepareUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    ///添加控件,约束
    private func prepareUI(){
    
        //添加控件
        addSubview(relayBtn)
        addSubview(commentBtn)
        addSubview(zanBtn)
        //添加约束
        relayBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.leading.equalTo(self)
            
        }
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.equalTo(self)
            make.width.equalTo(relayBtn)
            make.leading.equalTo(relayBtn.snp_trailing)
            
        }
        zanBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.trailing.equalTo(self)
            make.width.equalTo(relayBtn)
            make.leading.equalTo(commentBtn.snp_trailing)


        }
    }

    //MARK: - 懒加载
    private lazy var relayBtn:UIButton = UIButton(bgImageName: "timeline_card_bottom_background", imageName: "timeline_icon_retweet", title: "转发")
    private lazy var commentBtn:UIButton = UIButton(bgImageName: "timeline_card_bottom_background", imageName: "timeline_icon_comment", title: "评论")
    private lazy var zanBtn: UIButton = UIButton(bgImageName: "timeline_card_bottom_background", imageName: "timeline_icon_unlike", title: "赞")
}
